/*
 * @Description: 用户管理接口
 * @Author: Boide
 * @Date: 2021-08-25 14:15:40
 * @LastEditors: guiyi@hongyi.tech
 * @LastEditTime: 2021-09-10 19:00:29
 */
import http from '@/utils/request'

// 用户分页列表
export const userListPage = (data) => http.postJson('/user/listPage', data)

// 查询用户的角色和菜单信息
export const getUserRoles = () => http.get('/user/roles')

// 根据id查询用户
export const userGetId = (id) => http.get('/user/get/' + id)

// 新增用户
export const userRegister = (data) => http.postJson('/user/register', data)

// 修改用户
export const userUpdate = (data) => http.putJson('/user/update', data)

// 根据id删除用户
export const userDeleteId = (id) => http.delete('/user/delete/' + id)

// 批量删除用户
export const userDeleteBatch = (ids) => http.deleteJson('/user/deleteBatch', ids)

// 直接修改用户密码
export const userModifyPassword = (data) => http.putJson('/user/modifyPassword', data)

// 根据老密码修改用户密码
export const userModifySelfPassword = (data) => http.putJson('/user/modifySelfPassword', data)

// 根据用户id查询角色信息
export const getUserRolesId = (id) => http.get('/user/roles/' + id)

// 编辑用户角色
export const userUpdateRolesFromUser = (data) => http.putJson('/user/updateRolesFromUser', data)

// 获取当前用户所有菜单
export const getUserMenus = () => http.get('/user/menus')

// 获取用户信息
export const getInfo = () => http.get('/getInfo')
